import Vue from 'vue'
import VueRouter from 'vue-router'

Vue.use(VueRouter)

const routes = [
  {
    path: '',
    // redirect重定向
    redirect: '/login'
  },
  {
    path: '/login',
    name: 'Login',
    component: () => import('@/views/login/index.vue')
  },
  {
    path: '/home',
    name: 'Home',
    component: () => import('@/views/home/index.vue')
  },
  {
    path: '/goodsList',
    name: 'goodsList',
    component: () => import('@/views/goodsList/index.vue')
  },
  {
    path: '/goodsDetail',
    name: 'goodsDetail',
    component: () => import('@/views/goodsDetail/index.vue')
  },
  {
    path: '/shoppingCart',
    name: 'shoppingCart',
    component: () => import('@/views/shoppingCart/index.vue')
  },
  {
    path: '/pay',
    name: 'pay',
    component: () => import('@/views/pay/index.vue')
  },
  {
    path: '/order',
    name: 'order',
    component: () => import('@/views/order/index.vue')
  }
]

const router = new VueRouter({
  routes
})
export default router
